// 引入vue对象；引入vue-router
import Vue from "vue";
import VueRouter from "vue-router";

// 主页面
import Home from "../views/Homes/Home";
import NotFound from "../views/Homes/NotFound";
import Address from "../views/Homes/Address";


// 我的 页面
import Me from "../views/Mes/Me";
import RegSave from "../views/Mes/RegSave";
import Login from "../views/Mes/Login";
import Code from "../views/Mes/code";

// 百货页面
import Goodslist from "../views/GoodsLists/GoodsList";
import Addressadd from "../views/Homes/Addressadd";


// 点单页面
import Menu from "../views/Menus/Menu";
import detail from "../views/Menus/detail";


// 订单页面
import Order from "../views/Orders/Order";



// 把vue-router安装到Vue框架里
Vue.use(VueRouter);

// 创建 vue-router对象
export default new VueRouter({
    // mode: 'history',
    routes: [
        // 下面是 主页面的路由
        {
            // 主页
            path: "/",
            name: "Home",
            component: Home,
        }, 
        {
            path: "/Home",
            name: "Home",
            component: Home,
        },
        {
            path: "/Addressadd",
            name: "Addressadd",
            component: Addressadd,
        },


        // 下面是 百货 路由
        {
            path: "/Goodslist",
            name: "Goodslist",
            component: Goodslist,
        },

        // 下面是 点单 路由
        {
            path: "/Menu",
            name: "Menu",
            component: Menu,
        },
        {
            path: "/Detail",
            name: "Detail",
            component: detail,
        },

        // 下面是 我的 路由
        {
            path: "/Me",
            name: "Me",
            component: Me,
        },
        {
            path: "/RegSave",
            name: "RegSave",
            component: RegSave,
        },
        {
            path: "/Login",
            name: "Login",
            component: Login,
        }, {
            path: "/Code",
            name: "Code",
            component: Code,
        },


        // 下面是 订单 路由
        {
            path: "/Order",
            name: "Order",
            component: Order,
        },
    // 下面是 地址 路由
    {
        path: "/Address",
        name: "Address",
        component: Address,
    },
        // 404路由
        {
            path: "*",
            component: NotFound
        }
    ]
});